package com.jlpay.openapi.demo.openmerch.query;

import com.jlpay.open.jlpay.sdk.java.model.openmerch.query.request.MerchFeeQueryRequest;
import com.jlpay.open.jlpay.sdk.java.model.openmerch.query.response.MerchFeeQueryResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 商户费率信息查询
 * @author chenjunhong
 * @date 2024/4/15
 */
public class MerchFeeQueryService {
    private static final Logger LOGGER = LoggerFactory.getLogger(MerchFeeQueryService.class);

    public static void main(String[] args) {
        MerchFeeQueryRequest merchFeeQueryRequest = buildMerchFeeQueryRequest();
        MerchFeeQueryResponse merchFeeQueryResponse = JlpayOpenApiService.openMerchService()
                .post(merchFeeQueryRequest, MerchFeeQueryResponse.class);
        LOGGER.info("商户费率信息查询响应:{}", JsonUtils.toString(merchFeeQueryResponse));
    }

    private static MerchFeeQueryRequest buildMerchFeeQueryRequest() {
        MerchFeeQueryRequest merchFeeQueryRequest = new MerchFeeQueryRequest();
        // 商户号
        merchFeeQueryRequest.setMerchNo("849584358140108");
        return merchFeeQueryRequest;
    }
}
